# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=font-liberation-sans-narrow
_fontname=${pkgname#font-}
pkgver=1.07.6
pkgrel=2
pkgdesc="Sans-serif Narrow fonts to replace commonly used Microsoft Arial Narrow"
url="https://github.com/liberationfonts/liberation-sans-narrow"
license="GPL-2.0-or-later"
arch="noarch"
depends="fontconfig"
replaces="ttf-liberation<2.1.5"  # for backward compatibility (Alpine <3.16)
options="!check"
# added fontconfig configuration from:
# https://github.com/bohoomil/fontconfig-ultimate/tree/master/fontconfig_patches/fonts-settings
source="https://github.com/liberationfonts/liberation-sans-narrow/files/2579431/liberation-narrow-fonts-ttf-$pkgver.tar.gz
	30-$_fontname.conf
	45-$_fontname.conf
	90-$_fontname.conf
	"
builddir="$srcdir/liberation-narrow-fonts-ttf-$pkgver"

package() {
	install -D -m644 ./*.ttf -t "$pkgdir"/usr/share/fonts/$_fontname/
	install -D -m644 License.txt -t "$pkgdir"/usr/share/licenses/$pkgname/

	mkdir -p "$pkgdir"/etc/fonts/conf.d

	local i; for i in "$srcdir"/*.conf; do
		install -D -m644 "$i" -t "$pkgdir"/etc/fonts/conf.avail/
		ln -s ../conf.avail/${i##*/} "$pkgdir"/etc/fonts/conf.d/${i##*/}
	done
}

sha512sums="
bea2b8af3eaf32cc57faf1a582fdbef0ba3f2d5c2d9615f3c83c6b5aaac37856a25147cab26c3b18c3dca1b109b2a853874f5876dd6ae614676db3118f1bb804  liberation-narrow-fonts-ttf-1.07.6.tar.gz
a79487aa5f265ffa2660c252227706341485776b5fbc8419bf902a5110faea225f35a0dabed698ae50c0d0d50dd170aceadf158bd5ba9300b9a08fb3539a04d4  30-liberation-sans-narrow.conf
a2a0b95c2836c61d620246d6ff945941c04e16d05d6991a7d01abf2cd15a5723d57a70371a392f92074a70e120cea5326c0ef2c4af73bd57c7d3f864047e440b  45-liberation-sans-narrow.conf
efc095a4c9aa9a54eb50cc1110ae99ccb92a67a82b69ca1d000ce1b90ba076b3757d81ce73ea853a46bbc958cc8770b6d7947caa175a42513b97707f45daab69  90-liberation-sans-narrow.conf
"
